<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "stock");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style >
	.thumbnail{margin: 0px}
	td{height:21px;padding: 2px 2px !important;text-align:center }
	td input{height:21px; width:98%;border:none;}
	#area{
		height:420px;
		overflow-y:auto; 
		overflow-x:hidden; 
	}
</style>
	
<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body">
		<t:form modelAttribute="outStock" action="/stock/outStock/save" method="post" cssClass="form-horizontal">
			<div class="hide">
				 <t:hidden path="outStockId"/>
 				 <t:hidden path="deleteMark"/>	
 				 <t:hidden path="createUserName"/>
		 		 <t:hidden path="createUserId"/>
		 		 <t:hidden path="createDate"/>
		 		 <t:hidden path="shopId"/>
			</div>
			<t:formgroup>
            	<t:label path="billingNo" cssClass="col-sm-1 col-xs-1" />
                <t:input path="billingNo" colClass="col-sm-2 col-xs-2" />
                <t:label path="customerName" cssClass="col-sm-1 col-xs-1" />
                <t:input path="customerName" colClass="col-sm-2 col-xs-2" />
                <t:label path="outStockNum" cssClass="col-sm-1 col-xs-1" />
                <t:input path="outStockNum" colClass="col-sm-2 col-xs-2" />
                
                <t:label path="type" cssClass="col-sm-1 col-xs-1" />
                <t:select2 path="type" placeholder="出库类型" allowClear="true" colClass="col-sm-2 col-xs-2"></t:select2>
            </t:formgroup>
            <div id="area">
			<table  class="cntable table table-bordered dataTable table-billing">
	            <thead>
	            	<th style="width:80px">序号</th>
	            	<th style="width:150px">商品编码</th>
	            	<th style="width:150px">商品名称</th>
	            	<th style="width:150px">规格</th>
	            	<th style="width:100px">单位</th>
	            	<th style="width:100px">数量</th>
	            	
	            </thead>
	            
	            <tbody id="outStockInfo">
	            	<c:set var="sequence"  value="0"/>
	            	<c:forEach var="outStockShow" items="${outStock.outStockShows}">
							<c:forEach var="outStockCollocation" items="${outStockShow.outStockCollocations}" >
								
								<tr id="outStockCollocation_${sequence}">
									<td style="display:none"><input id="collocationId_${sequence}" name="collocationId" type="text" value="${outStockCollocation.collocationId}"/></td>
									<td style="display:none"><input id="cargoId_${sequence}" name="cargoId" type="text" value="${outStockShow.cargoId}"/></td>
									<td>${sequence+1}</td>					
					            	<td><input style="ime-mode:disabled" id="cargoNo_${sequence}" name="cargoNo" type="text" value="${outStockShow.cargo.cargoNo}"></input></td>
					            	<td><input style="ime-mode:disabled" id="cargoName_${sequence}" name="cargoName" type="text" value="${outStockShow.cargo.cargoName}"/></td>
					            	<td><input readonly="readonly" id="propertyName_${sequence}" name="propertyName" type="text" value="${outStockCollocation.collocation.propertyNameOne}/${outStockCollocation.collocation.propertyNameTwo}"/></td>
									<td ><input style="ime-mode:disabled" did="unit_${sequence}" name="unit" type="text" value="${outStockCollocation.unit}"/></td>
									<td><input style="ime-mode:disabled"  onkeyup="return ValidateNumber(this,value)" id="collocationNum_${sequence}"  name="collocationNum" type="text" value="${outStockCollocation.collocationNum}"/></td>
								</tr>
								<c:set var="sequence"  value="${sequence +1}"/>
							</c:forEach>
						</c:forEach>
				</tbody>
            </table>
            </div>
		</t:form>
	</div>
</t:panel>

<script type="text/javascript">

function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}	


</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
